import { http } from "@/utils/http";

type ResultTable = {
  total?: number;
  data?: Array<any>;
};

// 查询位置列表
export const getTableData = (data?: Record<string, any>) => {
  return http.request<ResultTable>("post", "/digitaltwins/api/v1/position/queryTree", { data });
};

// 查询位置列表带有厂区，位置管理专用
export const getPositionData = (data?: Record<string, any>) => {
  return http.request<ResultTable>("post", "/digitaltwins/api/v1/position/queryTreeForAdmin", { data });
};

// 新增位置
export const addData = (data?: Record<string, any>) => {
  return http.request("post", "/digitaltwins/api/v1/position/create", { data });
};

// 修改位置
export const editData = (data?: Record<string, any>) => {
  return http.request("post", "/digitaltwins/api/v1/position/update", { data });
};

// 删除位置
export const deleteData = (data?: Record<string, any>) => {
  return http.request("post", "/digitaltwins/api/v1/position/delete", { data });
};
